Singleton class that implements IScreen


Properties


AutoSizeViewportOnRoomLoad

Gets/sets whether the game should automatically adjust primary viewport and primary camera to the size of the room background each time the new room is loaded.


Height

int Height

Gets the native height of the game screen in pixels, which matches game resolution you set in the Editor.


Viewport

Viewport Viewport

Gets the primary room viewport. This is the default viewport that is created automatically at the start of the game and cannot be deleted.


ViewportCount

int ViewportCount

Gets the number of viewports.


Viewports

ViewportCollection Viewports

Returns the Viewport instance by its index. There's always at least primary viewport at the index 0, more could be created in script using Viewport.Create.


Width

int Width

Gets the native width of the game screen in pixels, which matches game resolution you set in the Editor.


Methods


RoomToScreenPoint

Point RoomToScreenPoint(int rx, int ry)

Returns the point on screen corresponding to the given room coordinates if seen through the primary viewport.


ScreenToRoomPoint

Point ScreenToRoomPoint(int sx, int sy)

Returns the point in room corresponding to the given screen coordinates, but only if there's at least one visible viewport at that location.